package org.millioncall.yueyoga.admin.service.impl;

import java.io.FileInputStream;
import java.util.List;

import org.millioncall.yueyoga.admin.dao.DbFileDAO;
import org.millioncall.yueyoga.admin.model.DbFile;
import org.millioncall.yueyoga.admin.service.DbFileService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class DbFileServiceImpl implements DbFileService {
	@Autowired
	private DbFileDAO dbFileDAO;

	@Override
	public void save(DbFile file) {
		this.dbFileDAO.save(file);
	}

	@Override
	public void update(DbFile file) {
		this.dbFileDAO.update(file);
	}

	@Override
	public void delete(DbFile file) {
		this.dbFileDAO.delete(file);
	}

	@Override
	public int deleteByName(String name) {
		return this.dbFileDAO.deleteByName(name);
	}

	@Override
	public int deleteById(String id) {
		return this.dbFileDAO.deleteById(id);
	}

	@Override
	public int deleteByIds(String[] ids) {
		return this.dbFileDAO.deleteByIds(ids);
	}

	@Override
	public DbFile findById(String id) {
		return this.dbFileDAO.findById(id);
	}

	@Override
	public DbFile findByName(String filename) {
		return this.dbFileDAO.findByName(filename);
	}

	@Override
	public List<DbFile> findAllByType(String type) {
		return this.dbFileDAO.findAllByType(type);
	}

	@Override
	public List<DbFile> findAll() {
		return this.dbFileDAO.findAll();
	}

	@Override
	public DbFile saveByExt(int i, String ext, FileInputStream fileInputStream) {
		// TODO Auto-generated method stub
		return null;
	}

}
